package com.yict.csms.system.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.yict.common.dao.impl.BaseDao;
import com.yict.csms.system.dao.ICostProfessionDao;
import com.yict.csms.system.entity.CostProfession;

@Repository("costProfessionDao")
public class CostProfessionDaoImpl extends BaseDao<CostProfession, String> implements ICostProfessionDao {

	public List<CostProfession> findByOProId(Long id) {
		List<CostProfession> list = new ArrayList<CostProfession>();
		String queryString = "from CostProfession as c where 1=1 and c.orderProfeid.profeid =:id";
		try {
			Query query = this.getSession().createQuery(queryString);
			query.setParameter("id", id);
			list = query.list();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}
}
